/**
 * Copyright 2020 OPSLI 快速开发平台 https://www.opsli.com
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
#if(data.subModuleName != null && data.subModuleName != "")
package #(apiPath).wrapper.#(data.moduleName+"."+data.subModuleName);
#else
package #(apiPath).wrapper.#(data.moduleName);
#end

import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import #(apiPath).base.warpper.ApiWrapper;
import org.opsli.common.annotation.validation.ValidationArgs;
import org.opsli.common.annotation.validation.ValidationArgsLenMax;
import org.opsli.common.enums.ValiArgsType;
import org.opsli.plugins.excel.annotation.ExcelInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @BelongsProject: opsli-boot
#if(data.subModuleName != null && data.subModuleName != "")
 * @BelongsPackage: #(apiPath).wrapper.#(data.moduleName+"."+data.subModuleName)
#else
 * @BelongsPackage: #(apiPath).wrapper.#(data.moduleName)
#end
 * @Author: #(data.authorName)
 * @CreateTime: #(currTime)
 * @Description: #(data.codeTitle)
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class #(data.model.tableName)Model extends ApiWrapper {

    #for(column : data.model.columnList)
    ### 不等于 删除字段 和 不等于 租户字段放入上边
    #if(column.fieldName != "deleted" && column.fieldName != "tenantId")
    /** #(column.fieldComments) */
    @ApiModelProperty(value = "#(column.fieldComments)")
    @ExcelProperty(value = "#(column.fieldComments)", order = #(column.sort))
    #if(column.dictTypeCode != null && column.dictTypeCode != "")
    @ExcelInfo( dictType = "#(column.dictTypeCode)" )
    #else
    @ExcelInfo
    #end
    // 验证器
    #if(column.validateType != null && column.validateType != "")
    @ValidationArgs({#(column.validateType)})
    #end
    #if(column.fieldLength != null && column.fieldLength > 0)
    #if(column.fieldPrecision != null && column.fieldPrecision > 0)
    @ValidationArgsLenMax(#(column.fieldLength+column.fieldPrecision))
    #else
    @ValidationArgsLenMax(#(column.fieldLength))
    #end
    #end
    ### 日期处理
    #if(column.javaType == "Date" && column.showType == "3")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    #else if(column.javaType == "Date" && column.showType == "4")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    #end
    private #(column.javaType) #(column.fieldName);

    #end
    #end


}
